package com.ruoyi.history.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * ai对话历史信息对象 ai_chat_history
 * 
 * @author ruoyi
 * @date 2025-04-24
 */
public class AiChatHistory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 用户ID */
    @Excel(name = "用户ID")
    @JsonProperty(value = "userId") @JsonPropertyDescription("userId, 比如1")
    private Long userId;

    /** 会话名称（可自定义） */
    @Excel(name = "会话名称", readConverterExp = "可=自定义")
    private String sessionName;

    /** 聊天内容（JSON数组） */
    @Excel(name = "聊天内容", readConverterExp = "J=SON数组")
    @JsonProperty(value = "messages") @JsonPropertyDescription("用JSON存储的用户历史对话信息, 比如" +
            "[{\"content\":\"\uD83E\uDDD1\u200D\uD83D\uDCBB 你好\",\"isUser\":true,\"timestamp\":\"2025/4/24 20:46:42\"},{\"content\":\"你好呀！我是京龙医院的助手，有什么可以帮助您的吗？我们这里有内科、外科和骨科哦！\",\"isUser\":false,\"timestamp\":\"2025/4/24 20:46:42\"}]")
    private String messages;

    /** 是否删除（0否 1是） */
    @Excel(name = "是否删除", readConverterExp = "0=否,1=是")
    private Integer isDeleted;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setSessionName(String sessionName) 
    {
        this.sessionName = sessionName;
    }

    public String getSessionName() 
    {
        return sessionName;
    }

    public void setMessages(String messages) 
    {
        this.messages = messages;
    }

    public String getMessages() 
    {
        return messages;
    }

    public void setIsDeleted(Integer isDeleted) 
    {
        this.isDeleted = isDeleted;
    }

    public Integer getIsDeleted() 
    {
        return isDeleted;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("sessionName", getSessionName())
            .append("messages", getMessages())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("isDeleted", getIsDeleted())
            .toString();
    }
}
